Previous Book Contents Book Index Next

Inside Macintosh: Mac OS 8 Toolbox Reference /
Chapter 5 - Menu Manager Reference / Menu Manager Functions
Defining Your Own Contextual Menu Plug-In /


Initialize

NEW WITH CONTEXTUAL MENUS

Performs any required plug-in initialization. If you write a contextual menu plug-in, you may include an Initialize method with the following form:

OSStatus Initialize (FSSpec *inFileSpec);
inFileSpec
A pointer to a file system specification record for the file that contains the plug-in.
method result
A result code. See "Result Codes" for a list of possible values. If this value is not noErr then the Menu Manager does not use the plug-in.
DISCUSSION
The Initialize method is called when the Menu Manager builds its registry of available plug-ins (typically at system startup). You should use the Initialize method to check for available resources before the plug-in is actually required. To maintain a small memory footprint, the Initialize method should not allocate any memory, buffers, or so on. Instead, you should allocate memory as needed when examining the context or acting on the selection.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
8 JAN 1998